﻿using System.Collections.Generic;

namespace HighDiveEngine.Model
{
    public class Diver : Person, IEqualityComparer<Diver>
    {
        public int? StartNumber { get; set; }
        public int? DbId { get; set; }

        public Diver()
        {
            DbId = null;
            StartNumber = null;
        }

        public Diver(Person person)
        {
            DbId = null;
            StartNumber = null;

            IdNumber = person.IdNumber;
            FirstName = person.FirstName;
            LastName = person.LastName;
            Address = person.Address;
            Club = person.Club;
            Email = person.Email;
            PersonDbId = person.PersonDbId;
            Gender = person.Gender;
        }

        public override string ToString()
        {
            return "#" + StartNumber + " " + FirstName + " " + LastName + " " + IdNumber;
        }

        public bool Equals(Diver x, Diver y)
        {
            return x.IdNumber == y.IdNumber;
        }

        public int GetHashCode(Diver obj)
        {
            return base.GetHashCode();
        }
    }
}
